package com.um.jdy.platform.screen.controller;



import com.um.jdy.platform.screen.entity.dto.HomeStationPageDTO;
import com.um.jdy.platform.screen.entity.dto.PileStausSummaryDTO;
import com.um.jdy.platform.screen.entity.vo.HomeStationItemVO;
import com.um.jdy.platform.screen.entity.vo.PileStatusSummaryVO;
import com.um.jdy.platform.screen.manager.HomeManager;
import com.um.springboot.starter.annotation.TokenRequired;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.controller.BaseController;
import com.um.springboot.starter.orm.entity.Response;
import com.um.springboot.starter.orm.params.PageParams;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 控制器：首页
 */
@RestController
@RequestMapping("/api/v1/cms/home")
@Api(tags = "设备管理", description = "首页概览")
@TokenRequired
public class HomeController extends BaseController<HomeManager> {

    @ApiOperation("分页查询站场列表")
    @PostMapping({"/page"})
    public Response<Page<HomeStationItemVO>> getStationPage(@RequestBody HomeStationPageDTO params){
        PageParams pageParams = params.toPageParams(new String[]{"deviceStationId","platformMerchantId"},new String[]{"s.device_station_id","s.platform_merchant_id"});
        return manager.getStationPage(pageParams);
    }

    @ApiOperation("查询设备状态统计数")
    @PostMapping({"status_summary"})
    public Response<PileStatusSummaryVO> getStatusSummary(@RequestBody PileStausSummaryDTO dto) {
        return manager.getStatusSummary(dto);
    }

//    @ApiOperation("查询站场枪列表及状态统计")
//    @GetMapping({"{station_id}/list_and_status_summary"})
//    public Response<GunListSummaryVO> getListAndStatusSummary(@ApiParam("站场ID") @PathVariable String station_id) {
//        return manager.getListAndStatusSummary(station_id);
//    }

}
